<template>
	<view>
		<u-navbar titleStyle="color:#fff" leftIconColor="#fff" bgColor="transparent" title="经销商" :autoBack="true"
			:placeholder="false">
		</u-navbar>
		<view class="login-top">
			<view class="top">
				<view class="top-title">
					添加经销商
				</view>
				<view class="top-text">
					{{info.title}}
				</view>
			</view>
		</view>
		<view class="login-content">
			<view class="dealer-item" v-for="(item,index) in info.data" :key="index">
				<view class="item-top">
					<image :src="'https://web.sunsk.top'+item.qrimg" mode=""></image>
					<view>
						{{item.nickname}}
					</view>
				</view>
				<view class="relate" v-if="item.weixin!=''">
					<view class="relate-left">
						<image src="/static/factory/chat.png" mode=""></image>
						<text>微信</text>
					</view>
					<view class="relate-right">
						<view>
							{{item.weixin || '暂无此联系方式'}}
						</view>
						<image src="/static/home/copy.png" @click="gocopy(item.weixin)" mode=""></image>
					</view>
				</view>
				<view class="relate" v-if="item.qq!=''">
					<view class="relate-left">
						<image src="/static/factory/qq.png" mode=""></image>
						<text>QQ</text>
					</view>
					<view class="relate-right">
						<view>
							{{item.qq || '暂无此联系方式'}}
						</view>
						<image src="/static/home/copy.png" @click="gocopy(item.qq)" mode=""></image>
					</view>
				</view>
				<view class="relate" v-if="item.app!=''">
					<view class="relate-left">
						<image src="/static/home/alipay.png" mode=""></image>
						<text>支付宝</text>
					</view>
					<view class="relate-right">
						<view>
							{{item.app || '暂无此联系方式'}}
						</view>
						<image src="/static/home/copy.png" @click="gocopy(item.app)" mode=""></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:{}
			}
		},
		onLoad() {
			this.jingottc()
		},
		methods: {
			gocopy(text) {
				uni.setClipboardData({
					data: text,
					showToast: false,
					success: function(res) {
						console.log(res)
						uni.showToast({
							title: '复制成功！',
							icon: 'none'
						})
					},
				})
			},
			jingottc() {
				let params = {

				}
				this.$Request({
					method: 'POST',
					url: '/api/index/Jingotc',
					data: params
				}).then(res => {
					console.log(res)
					this.info = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.login-top {
		height: 568rpx;
		background-image: url('../../../static/home/dealer-bg.png');
		background-repeat: no-repeat;
		background-size: 100% 568rpx;
		padding: 30rpx;

		.top {
			color: #fff;
			margin-top: 200rpx;

			.top-title {
				font-size: 55rpx;
				font-weight: 600;
				letter-spacing: 5px;
			}

			.top-text {
				font-size: 28rpx;
				margin-top: 20rpx;
			}
		}
	}

	.login-content {
		margin-top: -150rpx;
		min-height: 74vh;
		background-color: #250F5A;
		border-top-right-radius: 30rpx;
		border-top-left-radius: 30rpx;
		padding: 30rpx;
		color: #fff;

		.dealer-item {
			background-color: rgba(255, 255, 255, .05);
			padding: 30rpx;
			border-radius: 30rpx;
			margin-bottom: 30rpx;

			.item-top {
				display: flex;
				align-items: center;
				font-size: 28rpx;
				font-weight: 600;

				image {
					border-radius: 50%;
					width: 90rpx;
					height: 90rpx;
					margin-right: 30rpx;
				}
			}

			.relate {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 20rpx 30rpx;
				background-color: rgba(255, 255, 255, .05);
				border-radius: 30rpx;
				margin-top: 30rpx;

				.relate-left {
					display: flex;
					align-items: center;

					image {
						width: 66rpx;
						height: 66rpx;
						margin-right: 10px;
					}
				}

				.relate-right {
					display: flex;
					align-items: center;

					image {
						width: 26.99rpx;
						height: 26.99rpx;
						margin-left: 5px;
					}
				}
			}

		}
	}
</style>